package tmhm.shemes;

import java.awt.Point;
import java.util.ArrayList;

import tmhm.components.*;
import tmhm.gui.GuiLine;
import tmhm.gui.GuiScheme;


public class Uprav1 {

    private static DC DC7;
    private static NOT NOT1, NOT2, NOT3, NOT4, NOT5, NOT6, NOT7, NOT8, NOT9, NOT10, NOT11;
    private static AND AND1, AND2, AND3, AND4, AND5, AND6, AND7, AND8, AND9, AND10;
    private static AND AND11, AND12, AND13, AND14, AND15, AND16, AND17, AND18, AND19, AND20;
    private static OR OR1;
    private static GuiScheme gui;

    public static GuiScheme getGui() {
        return gui;
    }

    public static void init() {
        DC7 = new DC(5);
        NOT1 = new NOT();
        NOT2 = new NOT();
        NOT3 = new NOT();
        NOT4 = new NOT();
        NOT5 = new NOT();
        NOT6 = new NOT();
        NOT7 = new NOT();
        NOT8 = new NOT();
        NOT9 = new NOT();
        NOT10 = new NOT();
        NOT11 = new NOT();
        AND1 = new AND();
        AND2 = new AND();
        AND3 = new AND();
        AND4 = new AND();
        AND5 = new AND();
        AND6 = new AND();
        AND7 = new AND();
        AND8 = new AND();
        AND9 = new AND();
        AND10 = new AND();
        AND11 = new AND();
        AND12 = new AND();
        AND13 = new AND();
        AND14 = new AND();
        AND15 = new AND();
        AND16 = new AND();
        AND17 = new AND();
        AND18 = new AND();
        AND19 = new AND();
        AND20 = new AND();
        OR1 = new OR(21);

    }

    public static void connect() {
        DC7.setE(new Pin(true));
        DC7.setInputPin(0, Counter.mCW103());
        DC7.setInputPin(1, Counter.mCW102());
        DC7.setInputPin(2, Counter.mCW101());
        DC7.setInputPin(3, Counter.mCW100());
        DC7.setInputPin(4, Counter.mCW99());

        NOT1.setInputPin(0, Exec2.START());
        AND1.setInputPin(0, DC7.getOut(2));
        AND1.setInputPin(1, NOT1.getOut(0));

        AND2.setInputPin(0, DC7.getOut(3));
        AND2.setInputPin(1, Bus1.hack());

        NOT2.setInputPin(0, Bus1.fcCPU());
        AND3.setInputPin(0, DC7.getOut(4));
        AND3.setInputPin(1, NOT2.getOut(0));

        NOT3.setInputPin(0, Fetch3.gropr());
        AND4.setInputPin(0, DC7.getOut(5));
        AND4.setInputPin(1, NOT3.getOut(0));

        AND5.setInputPin(0, DC7.getOut(6));
        AND5.setInputPin(1, Fetch3.I1());

        NOT4.setInputPin(0, Fetch3.gradr());
        AND6.setInputPin(0, DC7.getOut(7));
        AND6.setInputPin(1, NOT4.getOut(0));

        AND7.setInputPin(0, DC7.getOut(8));
        AND7.setInputPin(1, Fetch3.I2_brnch());

        AND8.setInputPin(0, DC7.getOut(9));
        AND8.setInputPin(1, Fetch3.I2_arlog());

        AND9.setInputPin(0, DC7.getOut(10));
        AND9.setInputPin(1, Fetch3.I3_jump());

        AND10.setInputPin(0, DC7.getOut(11));
        AND10.setInputPin(1, Fetch3.I3_arlog());

        AND11.setInputPin(0, DC7.getOut(12));
        AND11.setInputPin(1, Fetch3.store());

        AND12.setInputPin(0, DC7.getOut(13));
        AND12.setInputPin(1, Fetch2.LDW());

        AND13.setInputPin(0, DC7.getOut(14));
        AND13.setInputPin(1, Fetch2.regdir());

        NOT5.setInputPin(0, Exec4.brpom());
        AND14.setInputPin(0, DC7.getOut(15));
        AND14.setInputPin(1, NOT5.getOut(0));

        NOT6.setInputPin(0, Intr1.prekid());
        AND15.setInputPin(0, DC7.getOut(16));
        AND15.setInputPin(1, NOT6.getOut(0));

        NOT7.setInputPin(0, Intr1.PRINS());
        AND16.setInputPin(0, DC7.getOut(17));
        AND16.setInputPin(1, NOT7.getOut(0));

        NOT8.setInputPin(0, Intr1.PRCOD());
        AND17.setInputPin(0, DC7.getOut(18));
        AND17.setInputPin(1, NOT8.getOut(0));

        NOT9.setInputPin(0, Intr1.PRADR());
        AND18.setInputPin(0, DC7.getOut(19));
        AND18.setInputPin(1, NOT9.getOut(0));

        NOT10.setInputPin(0, Intr1.PRINM());
        AND19.setInputPin(0, DC7.getOut(20));
        AND19.setInputPin(1, NOT10.getOut(0));

        NOT11.setInputPin(0, Intr2.printr());
        AND20.setInputPin(0, DC7.getOut(21));
        AND20.setInputPin(1, NOT11.getOut(0));

        OR1.setInputPin(0, DC7.getOut(1));
        OR1.setInputPin(1, AND1.getOut(0));
        OR1.setInputPin(2, AND2.getOut(0));
        OR1.setInputPin(3, AND3.getOut(0));
        OR1.setInputPin(4, AND4.getOut(0));
        OR1.setInputPin(5, AND5.getOut(0));
        OR1.setInputPin(6, AND6.getOut(0));
        OR1.setInputPin(7, AND7.getOut(0));
        OR1.setInputPin(8, AND8.getOut(0));
        OR1.setInputPin(9, AND9.getOut(0));
        OR1.setInputPin(10, AND10.getOut(0));
        OR1.setInputPin(11, AND11.getOut(0));
        OR1.setInputPin(12, AND12.getOut(0));
        OR1.setInputPin(13, AND13.getOut(0));
        OR1.setInputPin(14, AND14.getOut(0));
        OR1.setInputPin(15, AND15.getOut(0));
        OR1.setInputPin(16, AND16.getOut(0));
        OR1.setInputPin(17, AND17.getOut(0));
        OR1.setInputPin(18, AND18.getOut(0));
        OR1.setInputPin(19, AND19.getOut(0));
        OR1.setInputPin(20, AND20.getOut(0));

    }

    public static void gui() {
        GuiLine line; // Pomocna promenljiva
        gui = new GuiScheme("tmhm/tmhm/images/Uprav1.png");

        ArrayList<ArrayList<Point>> sections;
        ArrayList<Point> points;


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(49, 396));
        points.add(new Point(63, 396));
        sections.add(points);
        line = new GuiLine(sections, Counter.mCW103());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(49, 411));
        points.add(new Point(63, 411));
        sections.add(points);
        line = new GuiLine(sections, Counter.mCW102());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(49, 426));
        points.add(new Point(63, 426));
        sections.add(points);
        line = new GuiLine(sections, Counter.mCW101());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(49, 441));
        points.add(new Point(63, 441));
        sections.add(points);
        line = new GuiLine(sections, Counter.mCW100());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(49, 456));
        points.add(new Point(63, 456));
        sections.add(points);
        line = new GuiLine(sections, Counter.mCW99());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(111, 660));
        points.add(new Point(111, 670));
        sections.add(points);
        line = new GuiLine(sections, new Pin(true));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 179));
        points.add(new Point(168, 179));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 194));
        points.add(new Point(209, 194));
        points.add(new Point(209, 58));
        points.add(new Point(547, 58));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(1));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 209));
        points.add(new Point(225, 209));
        points.add(new Point(225, 76));
        points.add(new Point(470, 76));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(2));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(454, 89));
        points.add(new Point(465, 89));
        sections.add(points);
        line = new GuiLine(sections, Exec2.START());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(492, 82));
        points.add(new Point(547, 82));
        sections.add(points);
        line = new GuiLine(sections, AND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 224));
        points.add(new Point(243, 224));
        points.add(new Point(243, 104));
        points.add(new Point(470, 104));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(3));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(454, 117));
        points.add(new Point(470, 117));
        sections.add(points);
        line = new GuiLine(sections, Bus1.hack());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 239));
        points.add(new Point(257, 239));
        points.add(new Point(257, 133));
        points.add(new Point(470, 133));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(4));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(454, 147));
        points.add(new Point(465, 147));
        sections.add(points);
        line = new GuiLine(sections, Bus1.fcCPU());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 254));
        points.add(new Point(275, 254));
        points.add(new Point(275, 162));
        points.add(new Point(470, 162));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(5));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 175));
        points.add(new Point(465, 175));
        sections.add(points);
        line = new GuiLine(sections, Fetch3.gropr());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 269));
        points.add(new Point(290, 269));
        points.add(new Point(290, 190));
        points.add(new Point(470, 190));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(6));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 204));
        points.add(new Point(470, 204));
        sections.add(points);
        line = new GuiLine(sections, Fetch3.I1());
        gui.addLine(line);
        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 284));
        points.add(new Point(305, 284));
        points.add(new Point(305, 218));
        points.add(new Point(470, 218));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(7));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 232));
        points.add(new Point(466, 232));
        sections.add(points);
        line = new GuiLine(sections, Fetch3.gradr());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 300));
        points.add(new Point(321, 300));
        points.add(new Point(321, 247));
        points.add(new Point(470, 247));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(8));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 260));
        points.add(new Point(470, 260));
        sections.add(points);
        line = new GuiLine(sections, Fetch3.I2_brnch());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 313));
        points.add(new Point(336, 313));
        points.add(new Point(336, 275));
        points.add(new Point(470, 275));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(9));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 289));
        points.add(new Point(470, 289));
        sections.add(points);
        line = new GuiLine(sections, Fetch3.I2_arlog());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 328));
        points.add(new Point(351, 328));
        points.add(new Point(351, 303));
        points.add(new Point(470, 303));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(10));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 317));
        points.add(new Point(470, 317));
        sections.add(points);
        line = new GuiLine(sections, Fetch3.I3_jump());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 343));
        points.add(new Point(366, 343));
        points.add(new Point(366, 332));
        points.add(new Point(470, 332));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(11));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 345));
        points.add(new Point(470, 345));
        sections.add(points);
        line = new GuiLine(sections, Fetch3.I3_arlog());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 360));
        points.add(new Point(470, 360));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(12));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 374));
        points.add(new Point(470, 374));
        sections.add(points);
        line = new GuiLine(sections, Fetch3.store());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 373));
        points.add(new Point(366, 373));
        points.add(new Point(366, 388));
        points.add(new Point(470, 388));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(13));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 402));
        points.add(new Point(470, 402));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.LDW());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 388));
        points.add(new Point(351, 388));
        points.add(new Point(351, 417));
        points.add(new Point(470, 417));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(14));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 430));
        points.add(new Point(470, 430));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.regdir());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 404));
        points.add(new Point(336, 404));
        points.add(new Point(336, 444));
        points.add(new Point(470, 444));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(15));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 458));
        points.add(new Point(466, 458));
        sections.add(points);
        line = new GuiLine(sections, Exec4.brpom());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 419));
        points.add(new Point(321, 419));
        points.add(new Point(321, 472));
        points.add(new Point(470, 472));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(16));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 486));
        points.add(new Point(466, 486));
        sections.add(points);
        line = new GuiLine(sections, Intr1.prekid());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 436));
        points.add(new Point(306, 436));
        points.add(new Point(306, 501));
        points.add(new Point(470, 501));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(17));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 514));
        points.add(new Point(466, 514));
        sections.add(points);
        line = new GuiLine(sections, Intr1.PRINS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 451));
        points.add(new Point(290, 451));
        points.add(new Point(290, 532));
        points.add(new Point(470, 532));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(18));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 546));
        points.add(new Point(466, 546));
        sections.add(points);
        line = new GuiLine(sections, Intr1.PRCOD());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 466));
        points.add(new Point(275, 466));
        points.add(new Point(275, 560));
        points.add(new Point(470, 560));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(19));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 574));
        points.add(new Point(466, 574));
        sections.add(points);
        line = new GuiLine(sections, Intr1.PRADR());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 481));
        points.add(new Point(256, 481));
        points.add(new Point(256, 592));
        points.add(new Point(470, 592));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(20));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 606));
        points.add(new Point(466, 606));
        sections.add(points);
        line = new GuiLine(sections, Intr1.PRINM());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 496));
        points.add(new Point(245, 496));
        points.add(new Point(245, 621));
        points.add(new Point(470, 621));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(21));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(455, 634));
        points.add(new Point(466, 634));
        sections.add(points);
        line = new GuiLine(sections, Intr2.printr());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 511));
        points.add(new Point(228, 511));
        points.add(new Point(228, 672));
        points.add(new Point(275, 672));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(22));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 526));
        points.add(new Point(207, 526));
        points.add(new Point(207, 702));
        points.add(new Point(275, 702));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(23));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 541));
        points.add(new Point(168, 541));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(24));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 555));
        points.add(new Point(168, 555));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(25));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 570));
        points.add(new Point(168, 570));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(26));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 585));
        points.add(new Point(168, 585));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(27));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 600));
        points.add(new Point(168, 600));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(28));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 615));
        points.add(new Point(168, 615));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(29));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 630));
        points.add(new Point(168, 630));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(30));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(158, 645));
        points.add(new Point(168, 645));
        sections.add(points);
        line = new GuiLine(sections, DC7.getOut(31));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(492, 110));
        points.add(new Point(547, 110));
        sections.add(points);
        line = new GuiLine(sections, AND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(492, 140));
        points.add(new Point(547, 140));
        sections.add(points);
        line = new GuiLine(sections, AND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 168));
        points.add(new Point(547, 168));
        sections.add(points);
        line = new GuiLine(sections, AND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 196));
        points.add(new Point(547, 196));
        sections.add(points);
        line = new GuiLine(sections, AND5.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 225));
        points.add(new Point(547, 225));
        sections.add(points);
        line = new GuiLine(sections, AND6.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 253));
        points.add(new Point(547, 253));
        sections.add(points);
        line = new GuiLine(sections, AND7.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 281));
        points.add(new Point(547, 281));
        sections.add(points);
        line = new GuiLine(sections, AND8.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 310));
        points.add(new Point(547, 310));
        sections.add(points);
        line = new GuiLine(sections, AND9.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 338));
        points.add(new Point(547, 338));
        sections.add(points);
        line = new GuiLine(sections, AND10.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 366));
        points.add(new Point(547, 366));
        sections.add(points);
        line = new GuiLine(sections, AND11.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 395));
        points.add(new Point(547, 395));
        sections.add(points);
        line = new GuiLine(sections, AND12.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 423));
        points.add(new Point(547, 423));
        sections.add(points);
        line = new GuiLine(sections, AND13.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 450));
        points.add(new Point(547, 450));
        sections.add(points);
        line = new GuiLine(sections, AND14.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 479));
        points.add(new Point(547, 479));
        sections.add(points);
        line = new GuiLine(sections, AND15.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 507));
        points.add(new Point(547, 507));
        sections.add(points);
        line = new GuiLine(sections, AND16.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 538));
        points.add(new Point(547, 538));
        sections.add(points);
        line = new GuiLine(sections, AND17.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 567));
        points.add(new Point(547, 567));
        sections.add(points);
        line = new GuiLine(sections, AND18.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 599));
        points.add(new Point(547, 599));
        sections.add(points);
        line = new GuiLine(sections, AND19.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(493, 627));
        points.add(new Point(547, 627));
        sections.add(points);
        line = new GuiLine(sections, AND20.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(570, 353));
        points.add(new Point(585, 353));
        sections.add(points);
        line = new GuiLine(sections, OR1.getOut(0));
        gui.addLine(line);

    }

    public static Pin br() {
        return DC7.getOut(1);
    }

    public static Pin bradr() {
        return DC7.getOut(22);
    }

    public static Pin bropr() {
        return DC7.getOut(23);
    }

    public static Pin branch() {
        return OR1.getOut(0);
    }

}
